var MyClutterActor = GObject.registerClass(
class MyClutterActor extends Clutter.Actor {
- vfunc_get_preferred_width(actor, forHeight) {
+ vfunc_get_preferred_width(forHeight) {
return [100, 100];
}
- vfunc_get_preferred_height(actor, forWidth) {
+ vfunc_get_preferred_height(forWidth) {
return [100, 100];
}
- vfunc_paint(actor) {
+ vfunc_paint() {
let alloc = this.get_allocation_box();
Cogl.set_source_color4ub(255, 0, 0, 255);
Cogl.rectangle(alloc.x1, alloc.y1,
super._init();
}
- vfunc_get_preferred_width(container, forHeight) {
+ vfunc_get_preferred_width(forHeight) {
if (this._source.visible)
return this._source.get_preferred_width(forHeight);
return [0, 0];
}
- vfunc_get_preferred_height(container, forWidth) {
+ vfunc_get_preferred_height(forWidth) {
if (this._source.visible)
return this._source.get_preferred_height(forWidth);
return [0, 0];
return global.display.get_monitor_geometry(monitorIndex);
}
- vfunc_gesture_prepare(action, actor) {
+ vfunc_gesture_prepare(actor) {
if (this.get_n_current_points() == 0)
return false;
(this._side == St.Side.BOTTOM && y > monitorRect.y + monitorRect.height - EDGE_THRESHOLD));
}
- vfunc_gesture_progress(action, actor) {
+ vfunc_gesture_progress(actor) {
let [startX, startY] = this.get_press_coords(0);
let [x, y] = this.get_motion_coords(0);
let offsetX = Math.abs (x - startX);
return true;
}
- vfunc_gesture_end(action, actor) {
+ vfunc_gesture_end(actor) {
let [startX, startY] = this.get_press_coords(0);
let [x, y] = this.get_motion_coords(0);
let monitorRect = this._getMonitorRect(startX, startY);
this._texture = null;
}
- vfunc_get_preferred_size(content) {
+ vfunc_get_preferred_size() {
if (!this._texture)
return [0, 0];
return [this._texture.get_width(), this._texture.get_height()];
}
- vfunc_paint_content(content, actor, node) {
+ vfunc_paint_content(actor, node) {
if (!this._texture)
return;
this._updateSolidStyle();
}
- vfunc_get_preferred_width(actor, forHeight) {
+ vfunc_get_preferred_width(forHeight) {
let primaryMonitor = Main.layoutManager.primaryMonitor;
if (primaryMonitor)
});
}
- vfunc_gesture_prepare(action, actor) {
+ vfunc_gesture_prepare(actor) {
return Main.actionMode == Shell.ActionMode.NORMAL &&
this.get_n_current_points() == this.get_n_touch_points();
}
height: maxY - minY });
}
- vfunc_gesture_begin(action, actor) {
+ vfunc_gesture_begin(actor) {
this._initialRect = this._getBoundingRect(false);
return true;
}
- vfunc_gesture_end(action, actor) {
+ vfunc_gesture_end(actor) {
let rect = this._getBoundingRect(true);
let oldArea = this._initialRect.width * this._initialRect.height;
let newArea = rect.width * rect.height;
});
}
- vfunc_gesture_prepare(action, actor) {
+ vfunc_gesture_prepare(actor) {
if (Main.actionMode != Shell.ActionMode.NORMAL) {
this.cancel();
return false;
return this.get_n_current_points() <= 4;
}
- vfunc_gesture_begin(action, actor) {
+ vfunc_gesture_begin(actor) {
// in milliseconds
const LONG_PRESS_TIMEOUT = 250;
return this.get_n_current_points() <= 4;
}
- vfunc_gesture_progress(action, actor) {
+ vfunc_gesture_progress(actor) {
const MOTION_THRESHOLD = 30;
if (this.get_n_current_points() == 3) {